#include <iostream>
using namespace std;
int main()
{
	int x,sum=0;
	cin>>x;
	while(x){
		x&=(x-1);
		sum++;
	}
	cout<<sum<<endl;
	return 0;
}

